Tailwind CSS utilizes breakpoints to define responsiveness in your web layouts. These breakpoints represent different screen width ranges, allowing you to apply styles conditionally based on the device size.
Prefix | Screen min Width |
sm | 640px |
md | 768px |
lg | 1024px |
xl | 1280px |
2xl | 1536px |
While Tailwind offers default breakpoints, we can customize them to fit your project's specific needs. You can achieve this by editing the theme.screens section in your tailwind.config.js
file.
module.exports = {
theme: {
screens: {
'sm': '640px',
'md': '768px',
'lg': '1024px',
'xl': '1280px',
'2xl': '1536px',
// Add your custom breakpoint
}
}
}
Note: We can also add new breakpoints as required in Project.